//=================================����SSBλ�ú��ٶ�================================
//==================================================================================
/****************************
 �㷨ȡ�ԡ������㷨��
 ****************************/
var evTab = new Array( //�����SSB�ٶȼ����
    1, 1, 0, 0, 0, 0, -1719914, -25, 25, 1578089, 10, 684185, //01
    2, 1, 0, 0, 0, 0, 6434, 28007, 25697, -5904, 11141, -2559,
    1, 3, 0, 0, 0, 0, 715, 0, 6, -657, -15, -282,
    1, 7, 0, 0, 0, 0, 715, 0, 0, -656, 0, -285,
    3, 1, 0, 0, 0, 0, 486, -236, -216, -446, -94, -193,
    1, 4, 0, 0, 0, 0, 159, 0, 2, -147, -6, -61, //06
    1, 10, 0, 0, 0, 0, 0, 0, 0, 26, 0, -59,
    1, 7, 1, 9, 0, 0, 39, 0, 0, -36, 0, -16,
    2, 3, 0, 0, 0, 0, 33, -10, -9, -30, -5, -13,
    2, 1, -1, 3, 0, 0, 31, 1, 1, -28, 0, -12,
    3, 1, -8, 2, 3, 3, 8, -28, 25, 8, 11, 3, //11
    5, 1, -8, 2, 3, 3, 8, -28, -25, -8, -11, -3,
    2, 0, -1, 1, 0, 0, 21, 0, 0, -19, 0, -8,
    1, 0, 0, 0, 0, 0, -19, 0, 0, 17, 0, 8,
    1, 5, 0, 0, 0, 0, 17, 0, 0, -16, 0, -7,
    1, 1, -2, 3, 0, 0, 16, 0, 0, 15, 1, 7, //16
    1, 6, 0, 0, 0, 0, 16, 0, 1, -15, -3, -6,
    1, 1, 1, 3, 0, 0, 11, -1, -1, -10, -1, -5,
    2, 0, -2, 1, 0, 0, 0, -11, -10, 0, -4, 0,
    1, 1, -1, 3, 0, 0, -11, -2, -2, 9, -1, 4,
    4, 1, 0, 0, 0, 0, -7, -8, -8, 6, -3, 3, //21
    3, 1, -2, 3, 0, 0, -10, 0, 0, 9, 0, 4,
    1, 0, -2, 1, 0, 0, -9, 0, 0, -9, 0, -4,
    2, 0, -3, 1, 0, 0, -9, 0, 0, -8, 0, -4,
    2, 4, 0, 0, 0, 0, 0, -9, -8, 0, -3, 0,
    2, 0, -4, 1, 0, 0, 0, -9, 8, 0, 3, 0, //26
    3, 1, -2, 2, 0, 0, 8, 0, 0, -8, 0, -3,
    1, 7, 2, 8, -1, 9, 8, 0, 0, -7, 0, -3,
    8, 0, -12, 1, 0, 0, -4, -7, -6, 4, -3, 2,
    8, 0, -14, 1, 0, 0, -4, -7, 6, -4, 3, -2,
    2, 2, 0, 0, 0, 0, -6, -5, -4, 5, -2, 2, //31
    3, 0, -4, 1, 0, 0, -1, -1, -2, -7, 1, -4,
    2, 1, -2, 3, 0, 0, 4, -6, -5, -4, -2, -2,
    3, 0, -3, 1, 0, 0, 0, -7, -6, 0, -3, 0,
    2, 1, -2, 2, 0, 0, 5, -5, -4, -5, -2, -2,
    1, 7, -2, 8, 0, 0, 5, 0, 0, -5, 0, -2, //36

    1, 1, 0, 0, 0, 0, -2, 0, -13, 156, 32, -358, //���п�ʼΪ������
    2, 1, 0, 0, 0, 0, 141, -107, -95, -130, -48, -55,
    3, 1, 0, 0, 0, 0, -5, -4, -4, 5, 0, 0
);

function evSSB(t) { //�����SSB�ٶ�, t��������, �ٶȵ�λAU/����, ƽ�����4*10^-8AU/��
    var J = new Array(
        3.1761467 + 1021.3285546 * t, //��
        1.7534703 + 628.3075849 * t, //��
        6.2034809 + 334.0612431 * t, //��
        0.5995465 + 52.9690965 * t, //ľ
        0.8740168 + 21.3299095 * t, //��
        5.4812939 + 7.4781599 * t, //��
        5.3118863 + 3.8133036 * t, //��
        3.8103444 + 8399.6847337 * t, //�� L'
        5.1984667 + 7771.3771486 * t, //�� D
        2.3555559 + 8328.6914289 * t, //�� M'
        1.6279052 + 8433.4661601 * t  //�� F
    );
    var i, k, c, S, C, Tn = 1;
    var v = new Array(0, 0, 0), F = evTab;
    for (i = 0; i < 39; i++) {
        if (i >= 36) Tn = t;
        k = i * 12;
        c = F[k] * J[F[k + 1]] + F[k + 2] * J[F[k + 3]] + F[k + 4] * J[F[k + 5]];
        S = sin(c), C = cos(c);
        v[0] += ( F[k + 6] * S + F[k + 7] * C ) * Tn;
        v[1] += ( F[k + 8] * S + F[k + 9] * C ) * Tn;
        v[2] += ( F[k + 10] * S + F[k + 11] * C ) * Tn;
    }
    v[0] *= 0.00036525, v[1] *= 0.00036525, v[2] *= 0.00036525;
    return v;
}

var epTab = new Array(
    999829, 1.753486, 6283.07585, 999892, 0.182659, 6283.07585,
    8353, 1.710345, 12566.1517, 24427, 3.141593, 0,
    5611, 0, 0, 8353, 0.139529, 12566.1517,
    105, 1.667226, 18849.22755, 105, 0.096417, 18849.22755,

    31, 0.668752, 83996.8473181, 31, 5.381141, 83996.8473181,
    26, 0.583102, 529.6909651, 26, 5.30104, 529.6909651,
    21, 1.092352, 1577.3435424, 21, 2.662535, 1577.3435424,
    17, 0.495402, 6279.5527316, 17, 5.207804, 6279.5527316,
    17, 6.153155, 6286.5989683, 17, 4.582329, 6286.5989683,
    14, 3.472728, 2352.8661538, 14, 1.900682, 2352.8661538,
    11, 3.689848, 5223.6939198, 11, 5.273134, 5223.6939198,
    9, 6.073899, 12036.4607349, 9, 4.503012, 12036.4607349,
    9, 3.17572, 10213.2855462, 9, 1.605633, 10213.2855462,
    6, 2.15262, 1059.3819302, 6, 0.581422, 1059.3819302,
    7, 1.30699, 5753.3848849, 7, 2.807289, 398.1490034,
    7, 4.355002, 398.1490034, 6, 6.029239, 5753.3848849,
    7, 2.218215, 4705.7323075, 7, 0.647296, 4705.7323075,
    6, 5.384792, 6812.7668151, 6, 3.813815, 6812.7668151,
    5, 6.087683, 5884.9268466, 5, 4.527856, 5884.9268466,
    5, 1.279337, 6256.7775302, 5, 5.991672, 6256.7775302,

    -5196635 / 1048, 0.599451, 529.6909651, -5195200 / 1048, 5.312032, 529.6909651, //ľ��
    -9516383 / 3504, 0.874414, 213.2990954, -9529869 / 3504, 5.586006, 213.2990954, //����
    -30058900 / 19434, 5.312113, 38.1330356, -30060560 / 19434, 3.740863, 38.1330356, //����
    -19173710 / 22927, 5.481334, 74.7815986, -19165180 / 22927, 3.910457, 74.7815986  //����

);
function epSSB(t) { //����SSB���,t����������,4λ��Ч����
    t /= 10;
    var i, x = 0, y = 0, z = 0, E, p = epTab;
    for (i = 0; i < epTab.length; i += 6) {
        x += p[i + 0] * cos(p[i + 1] + p[i + 2] * t);
        y += p[i + 3] * cos(p[i + 4] + p[i + 5] * t);
    }
    x += t * (1234 + 515 * cos(6.002663 + 12566.1517 * t) + 13 * cos(5.959431 + 18849.22755 * t) + 11 * cos(2.015542 + 6283.07585 * t) );
    y += t * ( 930 + 515 * cos(4.431805 + 12566.1517 * t) + 13 * cos(4.388605 + 18849.22755 * t) );
    z += t * (  54 + 2278 * cos(3.413725 + 6283.07585 * t) + 19 * cos(3.370613 + 12566.15170 * t) );
    x /= 1000000, y /= 1000000, z /= 1000000;

    var E = -84381.448 / rad;
    return new Array(x, z * sin(E) + y * cos(E), z * cos(E) - y * sin(E));
}
//=================================����ƫת=========================================
//==================================================================================
function ylpz(z, a) { //����ƫת,z���������,a̫��������
    var r = new Array(z[0], z[1], z[2]);
    var d = z[0] - a[0];
    var D = sin(z[1]) * sin(a[1]) + cos(z[1]) * cos(a[1]) * cos(d); //�ǶȲ������
    D = 0.00407 * ( 1 / (1 - D) + D / 2 ) / rad;
    r[0] += D * ( cos(a[1]) * sin(d) / cos(z[1]) );
    r[1] += D * ( sin(z[1]) * cos(a[1]) * cos(d) - sin(a[1]) * cos(z[1]) );
    r[0] = rad2mrad(r[0]);
    return r;
}


//=================================�׾���������в�=================================
//==================================================================================
/***********
 function getGxcConst(t){ //ȡ���ǹ��в������صĳ���
 var t2=t*t, t3=t2*t, t4=t3*t, t5=t4*t, r=new Object();
 r.K=20.49552/rad;        //���в��
 r.L= (280.4664567 +36000.76982779*t +0.0003032028*t2 +1/49931000*t3 -1/153000000*t4 -5e-12*t5)/180*Math.PI; //̫���ļ���ƽ�ƾ�
 r.p= (102.93735 +1.71946*t +0.00046*t2)/180*Math.PI; //���
 r.e=0.016708634 -0.000042037*t -0.0000001267*t2;
 return r;
}
 function HDzngxc(t,a){ //���в�Ƶ�����(����������в�),����һ��
 var r=getGxcConst(t); //ȡ���в����ĳ����ϵ��
 var dL=r.L-a[0], dP=r.p-a[0];
 var b = new Array();
 b[0] = a[0] - r.K*(cos(dL)-r.e*cos(dP)) / cos(a[1]);
 b[1] = a[1] - r.K*sin(a[1]) * (sin(dL)-r.e*sin(dP));
 b[2] = a[2];
 return b;
}
 function CDzngxc(t,a){ //����������в�Գ������Ӱ��ֵ,t����������(J2000����),����һ��
 //�Ȱ������˶���Բ���˶�
 var r=getGxcConst(t);            //ȡ���в����ĳ����ϵ��
 var E=prece(t,'E','P03');  //�Ƴཻ��,ȡ0.409Ҳ����,�Խ��Ӱ�첻�ܴ�
 var sinL=sin(r.L), cosL=cos(r.L);
 var cosE=cos(E), tanE=tan(E);
 var sinR=sin(a[0]),cosR=cos(a[0]);
 var sinD=sin(a[1]),cosD=cos(a[1]);
 var tcss=tanE*cosD-sinR*sinD;
 var b = new Array();
 b[0] = a[0] - r.K*(cosR*cosE*cosL+sinR*sinL)/cosD;  //�ྭ������в�����ֵ
 b[1] = a[1] - r.K*(cosL*cosE*tcss+cosR*sinD*sinL);  //��γ��
 //e������(���Ƿ���Բ�˶������)
 var sinp=sin(r.p), cosp=cos(r.p);
 b[0] += r.e*r.K*(cosR*cosE*cosp+sinR*sinp)/cosD;
 b[1] += r.e*r.K*(cosp*cosE*tcss+cosR*sinD*sinp);
 b[2] = a[2];
 return b;
}
 ***********/

//=================================�����Ӳ����в�=================================
//==================================================================================
function scGxc(z, v, f) { //�ϸ�ĺ����Ӳ����в����
    //zΪĳʱ�����������, �������, z�����е������¶��͹��в�
    //vΪͬ�ǿ̵��������, ֱ�����
    //f=0 ���й��в����, v��ΪSSB�ٶ�, �������z+v����(z��Ϊ����)
    //f=1 �������Ӳ����, v��ΪSSBλ��, �������z-v����(z��Ϊ����)
    //z��vӦͳһʹ��J2000������ϵ

    var r = new Array(z[0], z[1], z[2]);
    var c = cs_GS / cs_AU * 86400 * 36525; //����,AUÿ��������
    if (f) c = -z[2]; //���Ӳ�

    var sinJ = sin(z[0]), cosJ = cos(z[0]);
    var sinW = sin(z[1]), cosW = cos(z[1]);
    r[0] += rad2mrad(( v[1] * cosJ - v[0] * sinJ ) / cosW / c);
    r[1] += ( v[2] * cosW - ( v[0] * cosJ + v[1] * sinJ ) * sinW ) / c;
    return r;
}


//=================================̫��J2000�������================================
//==================================================================================
function sun2000(t, n) {
    var a = e_coord(t, n, n, n);
    a[0] += Math.PI, a[1] = -a[1]; //̫��Date�Ƶ����
    a = HDllr_D2J(t, a, 'P03');  //ת��J2000���
    return a;
}

//=================================�����������=====================================
//==================================================================================

var xz88 = //88����?�ṹ������+��д,���(ƽ����),�ྭ (ʱ��),��γ(�ȷ�),���޽� �� ����Ӣ����
    '��Ů��And, 722.278, 0 48.46, 37 25.91,NQ1 Ӣ�� Andromeda,' //01
    + '��Ͳ��Ant, 238.901,10 16.43,-32 29.01,SQ2 ������ Antlia,'
    + '������APS, 206.327,16 08.65,-75 18.00,SQ3 �ݶ� Apus,'
    + '��ƿ��Aqr, 979.854,22 17.38,-10 47.35,SQ4 �Ƶ� Aquarius,'
    + '��ӥ��Aql, 652.473,19 40.02,  3 24.65,NQ4 ���� Aquila,'
    + '��̳��Ara, 237.057,17 22.49,-56 35.30,SQ3 ���� Ara,'
    + '������Ari, 441.395, 2 38.16, 20 47.54,NQ1 �Ƶ� Aries,'
    + '�����Aur, 657.438, 6 04.42, 42 01.68,NQ2 Ӣ�� Auriga,'
    + '������Boo, 906.831,14 42.64, 31 12.16,NQ3 ���� Bootes,'
    + '�����Cae, 124.865, 4 42.27,-37 52.90,SQ1 ������ Caelum,'   //10
    + '¹����Cam, 756.828, 8 51.37, 69 22.89,NQ2 ���� Camelopardalis,'
    + '��з��Cnc, 505.872, 8 38.96, 19 48.35,NQ2 �Ƶ� Cancer,'
    + '��Ȯ��CVn, 465.194,13 06.96, 40 06.11,NQ3 ���� Canes Venatici,'
    + '��Ȯ��CMa, 380.118, 6 49.74,-22 08.42,SQ2 �Ի� Canis Major,'
    + 'СȮ��CMi, 183.367, 7 39.17,  6 25.63,NQ2 �Ի� Canis Minor,'
    + 'Ħ����CAP, 413.947,21 02.93,-18 01.39,SQ4 �Ƶ� Capricornus,'
    + '������Car, 494.184, 8 41.70,-63 13.16,SQ2 ��֮ˮ Carina,'
    + '�ɺ���Cas, 598.407, 1 19.16, 62 11.04,NQ1 Ӣ�� Cassiopeia,'
    + '������Cen,1060.422,13 04.27,-47 20.72,SQ3 ���� Centaurus,'
    + '������Cep, 587.787,22 00.00, 71 00.51,NQ4 Ӣ�� Cepheus,'  //20
    + '������Cet,1231.411, 1 40.10, -7 10.76,SQ1 Ӣ�� Cetus,'
    + '������Cha, 131.592,10 41.53,-79 12.30,SQ2 �ݶ� Chamaeleon,'
    + 'Բ����Cir,  93.353,14 34.54,-63 01.82,SQ3 ������ Circinus,'
    + '�����Col, 270.184, 5 51.76,-35 05.67,SQ1 ��֮ˮ Columba,'
    + '����Com, 386.475,12 47.27, 23 18.34,NQ3 ���� Coma Berenices,'
    + '������CrA, 127.696,18 38.79,-41 08.85,SQ4 ���� Corona Australis,'
    + '������CrB, 178.710,15 50.59, 32 37.49,NQ3 ���� Corona Borealis,'
    + '��ѻ��Crv, 183.801,12 26.52,-18 26.20,SQ3 ���� Corvus,'
    + '�޾���Crt, 282.398,11 23.75,-15 55.74,SQ2 ���� Crater,'
    + '��ʮ��Cru,  68.447,12 26.99,-60 11.19,SQ3 ���� Crux,'   //30
    + '�����Cyg, 803.983,20 35.28, 44 32.70,NQ4 ���� Cygnus,'
    + '������Del, 188.549,20 41.61, 11 40.26,NQ4 ��֮ˮ Delphinus,'
    + '������Dor, 179.173, 5 14.51,-59 23.22,SQ1 �ݶ� Dorado,'
    + '������Dra,1082.952,15 08.64, 67 00.40,NQ3 ���� Draco,'
    + 'С����Equ,  71.641,21 11.26,  7 45.49,NQ4 ��֮ˮ Equuleus,'
    + '������Eri,1137.919, 3 18.02,-28 45.37,SQ1 ��֮ˮ Eridanus,'
    + '��¯��For, 397.502, 2 47.88,-31 38.07,SQ1 ������ Fornax,'
    + '˫����Gem, 513.761, 7 04.24, 22 36.01,NQ2 �Ƶ� Gemini,'
    + '�����Gru, 365.513,22 27.39,-46 21.11,SQ4 �ݶ� Grus,'
    + '������Her,1225.148,17 23.16, 27 29.93,NQ3 ���� Hercules,' //40
    + 'ʱ����Hor, 248.885, 3 16.56,-53 20.18,SQ1 ������ Horologium,'
    + '������Hya,1302.844,11 36.73,-14 31.91,SQ2 ���� Hydra,'
    + 'ˮ����Hyi, 243.035, 2 20.65,-69 57.39,SQ1 �ݶ� Hydrus,'
    + 'ӡ�ڰ�Ind, 294.006,21 58.33,-59 42.40,SQ4 �ݶ� Indus,'
    + 'Ы����Lac, 200.688,22 27.68, 46 02.51,NQ4 Ӣ�� Lacerta,'
    + 'ʨ����Leo, 946.964,10 40.03, 13 08.32,NQ2 �Ƶ� Leo,'
    + 'Сʨ��LMi, 231.956,10 14.72, 32 08.08,NQ2 ���� Leo Minor,'
    + '������Lep, 290.291, 5 33.95,-19 02.78,SQ1 �Ի� Lepus,'
    + '�����Lib, 538.052,15 11.96,-15 14.08,SQ3 �Ƶ� Libra,'
    + '������Lup, 333.683,15 13.21,-42 42.53,SQ3 ���� Lupus,'  //50
    + '��è��Lyn, 545.386, 7 59.53, 47 28.00,NQ2 ���� Lynx,'
    + '������Lyr, 286.476,18 51.17, 36 41.36,NQ4 ���� Lyra,'
    + 'ɽ����Men, 153.484, 5 24.90,-77 30.24,SQ1 ������ Mensa,'
    + '��΢��Mic, 209.513,20 57.88,-36 16.49,SQ4 ������ Microscopium,'
    + '������Mon, 481.569, 7 03.63,  0 16.93,NQ2 �Ի� Monoceros,'
    + '��Ӭ��Mus, 138.355,12 35.28,-70 09.66,SQ3 �ݶ� Musca,'
    + '�س���Nor, 165.290,15 54.18,-51 21.09,SQ3 ������ Norma,'
    + '�ϼ���Oct, 291.045,23 00.00,-82 09.12,SQ4 ������ Octans,'
    + '�߷���Oph, 948.340,17 23.69, -7 54.74,SQ3 ���� Ophiuchus,'
    + '�Ի���Ori, 594.120, 5 34.59,  5 56.94,NQ1 �Ի� Orion,' //60
    + '��ȸ��Pav, 377.666,19 36.71,-65 46.89,SQ4 �ݶ� Pavo,'
    + '������Peg,1120.794,22 41.84, 19 27.98,NQ4 Ӣ�� Pegasus,'
    + 'Ӣ����Per, 614.997, 3 10.50, 45 00.79,NQ1 Ӣ�� Perseus,'
    + '�����Phe, 469.319, 0 55.91,-48 34.84,SQ1 �ݶ� Phoenix,'
    + '�����Pic, 246.739, 5 42.46,-53 28.45,SQ1 ������ Pictor,'
    + '˫����Psc, 889.417, 0 28.97, 13 41.23,NQ1 �Ƶ� Pisces,'
    + '������PsA, 245.375,22 17.07,-30 38.53,SQ4 ��֮ˮ Piscis Austrinus,'
    + '��β��Pup, 673.434, 7 15.48,-31 10.64,SQ2 ��֮ˮ Puppis,'
    + '������Pyx, 220.833, 8 57.16,-27 21.10,SQ2 ��֮ˮ Pyxis,'
    + '�����Ret, 113.936, 3 55.27,-59 59.85,SQ1 ������ Reticulum,' //70
    + '�����Sge,  79.932,19 39.05, 18 51.68,NQ4 ���� Sagitta,'
    + '������Sgr, 867.432,19 05.94,-28 28.61,SQ4 �Ƶ� Sagittarius,'
    + '��Ы��Sco, 496.783,16 53.24,-27 01.89,SQ3 �Ƶ� Scorpius,'
    + '�����Scl, 474.764, 0 26.28,-32 05.30,SQ1 ������ Sculptor,'
    + '������Sct, 109.114,18 40.39, -9 53.32,SQ4 ���� Scutum,'
    + '������Ser, 636.928,16 57.04,  6 07.32,NQ3 ���� Serpens,'
    + '�����Sex, 313.515,10 16.29, -2 36.88,SQ2 ���� Sextans,'
    + '��ţ��Tau, 797.249, 4 42.13, 14 52.63,NQ1 �Ƶ� Taurus,'
    + '��Զ��Tel, 251.512,19 19.54,-51 02.21,SQ4 ������ Telescopium,'
    + '�����Tri, 131.847, 2 11.07, 31 28.56,NQ1 Ӣ�� Triangulum,'  //80
    + '�����TrA, 109.978,16 04.95,-65 23.28,SQ3 ���� Triangulum Australe,'
    + '�ž���Tuc, 294.557,23 46.64,-65 49.80,SQ4 �ݶ� Tucana,'
    + '������UMa,1279.660,11 18.76, 50 43.27,NQ2 ���� Ursa Major,'
    + 'С����UMi, 255.864,15 00.00, 77 41.99,NQ3 ���� Ursa Minor,'
    + '������Vel, 499.649, 9 34.64,-47 10.03,SQ2 ��֮ˮ Vela,'
    + '��Ů��Vir,1294.428,13 24.39, -4 09.51,SQ3 �Ƶ� Virgo,'
    + '������Vol, 141.354, 7 47.73,-69 48.07,SQ2 �ݶ� Volans,'
    + '������Vul, 268.165,20 13.88, 24 26.56,NQ4 ���� Vulpecula';
xz88 = xz88.split(',');


var HXK = new Array( //���ǿ�
                     // RA(ʱ����)   DEC(�ȷ���)   ����1  ����2  �Ӳ�  �ǵ�  ����  ����#

    '��0#* 0 01 57.620,- 6 00 50.68, 0.0031, -0.041, 0.008, 4.37 ,��1630 ,Psc 30 M3#* 0 03 44.391,-17 20 09.58, 0.0020, -0.007, 0.014, 4.55 ,��905  ,Cet 2  B9#* 0 05 20.142,- 5 42 27.45,-0.0009,  0.089, 0.025, 4.61 ,��1002 ,Psc 33 K1#* 0 08 23.260, 29 05 25.54, 0.0104, -0.163, 0.034, 2.07 ,��1    ,And �� B9#* 0 09 10.686, 59 08 59.19, 0.0681, -0.180, 0.060, 2.28 ,��2    ,Cas �� F2#* 0 10 19.247, 46 04 20.17, 0.0005,  0.001, 0.003, 5.01 ,��4    ,And 22 F2#* 0 11 34.421,-27 47 59.06, 0.0003,  0.016, 0.006, 5.41 ,��5    ,Scl ��2 K2#* 0 11 44.010,-35 07 59.24, 0.0138,  0.115, 0.046, 5.24 ,��6    ,Scl �� F3#* 0 13 14.154, 15 11 00.93, 0.0003, -0.008, 0.010, 2.83 ,��7    ,Peg �� B2#* 0 14 36.165, 20 12 24.12, 0.0064, -0.001, 0.010, 4.79 ,��1004 ,Peg �� M2#'
    + '* 0 17 05.500, 38 40 53.87,-0.0046, -0.013, 0.013, 4.61 ,N30    ,And �� A2#* 0 18 19.658, 36 47 06.79,-0.0055, -0.042, 0.023, 4.51 ,��1005 ,And �� A2#* 0 18 38.258, 31 31 02.01, 0.0044, -0.004, 0.006, 5.88 ,��1006 ,Pi 0h38 A0#* 0 19 25.676,- 8 49 26.14,-0.0010, -0.037, 0.011, 3.56 ,��9    ,Cet �� K2#* 0 20 35.863,  8 11 24.96,-0.0003,  0.010, 0.008, 5.38 ,��1008 ,Psc 41 K3#* 0 21 07.270, 37 58 06.95, 0.0049, -0.039, 0.020, 5.16 ,��1009 ,And �� F5#* 0 24 47.506, 61 49 51.80, 0.0018, -0.002, 0.004, 5.38 ,GC     ,Cas 12 B9#* 0 25 24.210,  1 56 22.87,-0.0010, -0.013, 0.006, 5.77 ,��1010 ,Psc 44 G5#* 0 25 45.092,-77 15 15.30, 0.6689,  0.323, 0.134, 2.82 ,��11   ,Hyi �� G2#* 0 26 17.052,-42 18 21.55, 0.0210, -0.354, 0.042, 2.40 ,��12   ,Phe �� K0#',
    '��1#'
    + '* 0 48 22.978,  5 16 50.19,  0.0507,-1.141,0.134, 5.74,��1019,G.Psc 96 K2#'
    + '* 0 26 17.052,-42 18 21.55,  0.0210,-0.354,0.042, 2.40,��12  ,Phe ��   K0#'
    + '* 2 36 00.049,- 7 49 53.77, -0.0022,-0.060,0.006, 5.53,��1074,Cet 80   M0#'
    + '* 2 35 52.472,  5 35 35.67, -0.0019,-0.024,0.009, 4.87,��1072,Cet ��   G8#'

    + '*18 36 27.834,  9 07 20.98, -0.0001,-0.132,0.026, 5.38,��1484,Oph 9  F5#'
    + '*18 36 56.338, 38 47 01.29,  0.0172, 0.288,0.129, 0.03,��699, Lyr �� A0#'
    + '*18 37 54.426,-21 23 51.81, -0.0001,-0.066,0.010, 5.93,��1485,Sgr 83 A5#'
    + '*18 42 16.428,- 9 03 09.14,  0.0005,-0.002,0.017, 4.70,��1486,Sct �� F2#'
    + '*18 43 31.254,- 8 16 30.76,  0.0013, 0.008,0.006, 4.88,��702, Sct �� G8#'
);

function schHXK(key) { //�ǿ����
    var i, s, n0, n1, n2, n3, r = '';
    for (i = 0; i < HXK.length; i++) { //���������ӿ�
        s = HXK[i];
        n0 = n1 = s.indexOf('#'); //��¼��ʼλ��
        while (1) {
            n1 = s.indexOf(key, n1 + 1);
            if (n1 == -1) break; //��key����
            n2 = s.indexOf('#', n1);
            if (n3 == -1) n2 = s.length; //�ü�¼�Ľ���λ��
            n3 = s.lastIndexOf('#', n1);
            if (n2 == -1) n3 = n0;       //�ü�¼�Ŀ�ʼλ��
            r += s.substr(n3, n2 - n3);
        }
    }
    for (i = 0; i < xz88.length; i += 5) { //��ȡ��������λ��
        if (xz88[i].substr(3, 3) == key) {
            var a = xz88[i + 2], b = xz88[i + 3];
            a = a.substr(0, 5) + ' ' + (a.substr(6, 2) * 0.6).toFixed(1);
            b = b.substr(0, 6) + ' ' + (b.substr(7, 2) * 0.6).toFixed(1);
            r = '#*' + a + ',' + b + ',0,0,0,0.0,����' + xz88[i + 1] + '��,' + xz88[i + 4] + r;
            break;
        }
    }
    return r;
}

function getHXK(s, all) { //��ȡ����ʽ�����ǿ�(�Ѷȷ��롢�Ƿ���תΪ����),all=1��ʾȫ��ȡ��
    var i, k, r = new Array();
    s = s.replace(/\r\n/g, '#');       //�ѻ��з�ſ���#��
    var sn = s.indexOf('#') + 1;
    s = s.substr(sn, s.length - sn);   //ȥ���1��
    s = s.replace(/\#+/g, ',');        //��#�ſ�������
    s = s.replace(/, +/g, ',');         //ȥ��ź�Ŀո�
    s = s.split(',');
    for (i = 0, k = 0; i < s.length; i += 8) {
        if (!s[i] || s[i].length < 5) continue;
        if (s[i].substr(0, 1) != '*' && !all) continue;
        s[i] = s[i].substr(1, s[i].length - 1);  //ȥ���Ǻ�
        r[k++] = str2rad(s[i + 0], 1); //�ྭ
        r[k++] = str2rad(s[i + 1], 0); //��γ
        r[k++] = s[i + 2] / rad * 15;  //�ྭ��������
        r[k++] = s[i + 3] / rad;     //��γ�ͼ�����
        r[k++] = s[i + 4] / rad;     //�Ӳ�
        r[k++] = s[i + 5];         //�ǵ�
        r[k++] = s[i + 6];         //�������Ϣ
        r[k++] = s[i + 7];         //�������
    }
    return r;
}


function hxCalc(t, F, Q, lx, L, fa) { //���ͬʱ����,t��������TD,ֻ���¶���������Q��(Ϊ0������)
    var i, z = new Array(), s = '';
    var d, E, v, p, a, s0;
    var gstP, gst;


    if (lx == 0) s0 = '�ӳྭ �ӳ�γ';
    if (lx == 1) s0 = 'վ�����';
    if (lx == 2) s0 = 'ƽ�ྭ ƽ��γ';

    if (lx == 0 || lx == 1) {
        d = nutation(t, Q); //�¶�
        E = hcjj(t);  //�Ƴཻ��
        v = evSSB(t); //����SSBֱ���ٶ�(���в�ʹ�õ�)
        p = epSSB(t); //����SSBֱ��λ��(�Ӳ�����ʹ�õ�)
        a = sun2000(t, 20); //̫��J2000�������(����ƫת�õ�)
        a = llrConv(a, 84381.406 / rad); //̫��������
        gstP = pGST2(t * 36525); //ƽ����ʱ
        gst = gstP + d[0] * Math.cos(E); //�����ʱ
    }
    for (i = 0; i < F.length; i += 8) {
        s += F[i + 6] + ' ' + F[i + 7] + ' ' + F[i + 5] + ' ';

        z[0] = F[i + 0] + F[i + 2] * t * 100; //J2000�ྭ������
        z[1] = F[i + 1] + F[i + 3] * t * 100; //J2000��γ������
        z[2] = 1 / F[i + 4];
        z[0] = rad2mrad(z[0]);
        if (!z[2]) z[2] = 1e11;

        if (lx == 0 || lx == 1) {
            z = ylpz(z, a);    //����ƫת����
            z = scGxc(z, p, 1); //�����Ӳ�����
            z = scGxc(z, v, 0); //���в�����
            z = CDllr_J2D(t, z, 'P03'); //ת�����ճ��(�������)
            z = CDnutation(z, E, d[0], d[1]); //�¶�����
            if (lx == 1) { //վ�����
                var sj = rad2rrad(gst + L - z[0]); //�õ��˿�����ʱ��
                z[0] += Math.PI / 2 - gst - L;       //ת������ڵ�ƽ����ֵ�ĳ�����
                z = llrConv(z, Math.PI / 2 - fa);    //���ǵ�ƽ���
                z[0] = rad2mrad(Math.PI / 2 - z[0]); //��λ��,�߶Ƚ�
                if (z[1] > 0) z[1] += MQC(z[1]);      //������������
            }
        }
        if (lx == 2) {
            z = CDllr_J2D(t, z, 'P03'); //ת�����ճ��(�������)
        }
        if (lx == 0 || lx == 2) s += rad2strE(z[0], 1, 3) + ' ' + rad2strE(z[1], 0, 2) + '\r\n';  //��λ�û�ƽλ��
        else             s += rad2strE(z[0], 0, 2) + ' ' + rad2strE(z[1], 0, 2) + '\r\n';
    }
    return JD.JD2str(t * 36525 + J2000) + ' TD ' + s0 + '\r\n' + s + '\r\n';
}

